﻿using System.Linq;
using System.Web.Mvc;
using GameSite.Models;

namespace GameSite.Controllers
{
    public class HomeController : Controller
    {
        private GameA4Context dbContext = new GameA4Context();

        public HomeController()
        {
            GlobalViewModel.CacheHome(ViewBag);
        }

        public ActionResult Index()
        {
            return View(new HomeViewModel(dbContext));
        }

        public ActionResult About()
        {
            return View(GlobalViewModel.ConfigModel);
        }

        protected override void Dispose(bool disposing)
        {
            dbContext.Dispose();
            base.Dispose(disposing);
        }
    }
}
